package com.lefu.risk.storm.bolt;

import clojure.lang.Obj;
import org.apache.storm.topology.BasicOutputCollector;
import org.apache.storm.topology.OutputFieldsDeclarer;
import org.apache.storm.topology.base.BaseBasicBolt;
import org.apache.storm.tuple.Fields;
import org.apache.storm.tuple.Tuple;
import org.apache.storm.tuple.Values;

/**
 * Created by mwang on 2016/12/29.
 */
public class CodeCountBolt extends BaseBasicBolt {

    @Override
    public void execute(Tuple tuple, BasicOutputCollector basicOutputCollector) {
        try {
            Object obj = tuple.getValueByField("info");
            if (obj != null){
                basicOutputCollector.emit(new Values(obj.toString() + "obj is processed!"));
            }

        } catch (Exception e) {


            e.printStackTrace();
        }
    }

    @Override
    public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
    }
}